#!/bin/sh

export ANT_OPTS="$ANT_OPTS -Djava.net.preferIPv4Stack=true -noverify"
echo "ANT_OPTS=$ANT_OPTS"
#
# setup to use bundled of ant
#

bundledAntIs=1

if test -d ../apache-ant
then
    ANT_HOME=../apache-ant
elif test -d ../../apache-ant
then
    ANT_HOME=../../apache-ant
else
    echo "WARNING: No bundled Ant found (../apache-ant or ../../apache-ant). Using system Ant"
    ANT_RUN=ant
    bundledAntIs=0
fi

if [ "$bundledAntIs" -eq "1" ];
then
    export ANT_HOME
    ANT_RUN=$ANT_HOME/bin/ant
    export ANT_RUN
    PATH=$ANT_HOME/bin:$PATH
    export PATH
fi

export BUILDOMATIC_MODE=${BUILDOMATIC_MODE:-interactive}

#
# Collect the command line args
#

CMD_LINE_ARGS=$*

$ANT_RUN --noconfig -nouserlib -f build.xml $CMD_LINE_ARGS

